function * foo1() {

	var a = yield  null ;
	console.log(`a = ${a}, 类型: ${typeof a}`);

	var b = yield 'hello'
	console.log(`b = ${b}, 类型: ${typeof b}`);


	var c = yield foo2()
	console.log(`c = ${c}, 类型: ${typeof c}`);

}


function * foo2() {

	return 'hello foo2'
}
var r1 = foo1()

console.log('---------------------------------------------------\n');
for(var a of r1) {
	console.log('for of 进行迭代', a)
}



console.log('---------------------------------------------------\n');
var r1 = foo1()
while(({value: a, done} = r1.next(Math.random())) && !done) {
	console.log('while 进行迭代', a)
}

